//用户信息存储表
var storageApp = new Vue({
    el:'#storageApp',
    data:{
        storage_arr:[],
        pageInfo:{},
    },
    methods:{
        loadStorages:function(pageNum) {
            if (!pageNum) {
                //默认查询第一页
                pageNum = 1;
            }
            axios.get("/storagelist",{
                params:{
                    pageNum:pageNum,
                }
            }).then(function (response) {
                storageApp.storage_arr = response.data.list;
                storageApp.pageInfo = response.data;
            }).catch(function (err) {
                alert(err);
            })
        },
        deleteById:function(storageId){
            axios.get("/deleteStorageById?storageId="+storageId).then(function (response) {
                location.reload();//删除完之后刷新
            }).catch(function (err) {
                alert(err);
            })
        }
    },
    created:function () {
        console.log("执行了方法");
        this.loadStorages();
    }
});
